﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class AttackTrigger : NetworkBehaviour
{
    public float damage;


    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player" && this.tag != "Eraser")
        {
            other.gameObject.GetComponent<PlaneHp>().TakeDamage(damage);
            Destroy(this.gameObject);
        }
        else if (other.tag == "MotherBase" && this.tag == "Eraser" )
        {
            other.gameObject.GetComponent<ManageMotherBase>().TakeDamage(damage);
            Destroy(this.gameObject);
        }
    }
}